<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>会员自助广告分类管理 - powered by 织梦技术研究中心！</title>
<link href="css/base.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language='javascript' src='js/main.js'></script>
<style type="text/css">
<!--
.STYLE1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>
<div class="bodytitle">
  <div class="bodytitleleft"></div>
  <div class="bodytitletxt"><b>会员自助广告分类管理</b></div>
</div>
<?php
if(empty($action))
{
?>
<form name="form2" action="mad_type.php" method="post">
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;margin-bottom:6px;">
      <tr>
        <td colspan="2" bgcolor="#EDF9D5" background="images/tbg.gif"><strong>&nbsp;添加分类</strong>
        <input type="hidden" name="action" value="add" /></td>
      </tr>
	    <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">新增分类名称：</td>
        <td height="20" bgcolor="#FFFFFF"><input type="text" name="name" value="" />(简短描述一下以便以后管理，例如：首页广告、列表页广告)</td>
      </tr>
	  <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">分类排列序号：</td>
        <td height="20" bgcolor="#FFFFFF"><input type="text" name="disorder" value="" />(用于会员页面，序号越小，排列越靠前)</td>
      </tr>
	  <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">该分类下广告数量：</td>
        <td height="20" bgcolor="#FFFFFF"><input type="text" name="num" value="" />(该广告系列准备投放的广告位数量)</td>
      </tr>
	  <tr>
        <td height="35" bgcolor="#FFFFFF">&nbsp;</td>
        <td height="20" bgcolor="#FFFFFF"><input type="submit" name="submit2" value="提交" class="np coolbg"/></td>
      </tr>
    </table>
</form>
<form name='frank' id='frank' action='mad_type.php' method='post'>
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" bgcolor="#E2F5BC" class="tbtitle">
  <tr>
    <td background="images/tbg.gif" colspan="5"><b>&nbsp;广告分类列表</b></td>
  </tr>
  <tr align="center" bgcolor="#FBFCE2">
    <td width="10%">分类排序</td>
	<td width="10%">分类ID</td>
    <td width="40%">分类名称</td>
	<td width="20%">广告数量</td>
    <td width="20%">管理操作</td>
  </tr>
  <input type='hidden' name='action' value='uprank' />
  <?php
$atts = array();
$atts['tagname'] = 'datalist';
$blockValue = $this->refObj->GetArcList($atts,$this->refObj,$fields); 
if(is_array($blockValue)){
foreach( $blockValue as $key=>$fields )
{
?>
  <tr align="center" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
    <td><input type='text' size='2' name="rank_<?php echo $fields['aid']?>" value="<?php echo $fields['disorder']?>" /></td>
	<td><?php echo $fields['aid']; ?></td>
	<td><?php echo $fields['name']; ?></td>
	<td><?php echo $fields['num']; ?></td>
    <td><a href=mad_type.php?action=edit&amp;aid=<?php echo $fields['aid']; ?>>修改</a> <a href=mad_type.php?action=delete&amp;aid=<?php echo $fields['aid']; ?>>删除</a></td>
  </tr>
  <?php
}
}?>
  <tr bgcolor="#FFFFFF">
    <td height="30" colspan="5">
    <input type='Submit' name='Submit' value='更新排序' style='width:80px;' class="np coolbg"/></td>
  </tr>

  <tr align="center" bgcolor="#FFFFFF" height="3">
    <td colspan="5" >
      <?php
$atts = array();
$atts['tagname'] = 'pagelist';
$atts['listitem'] = 'info,index,end,pre,next,pageno';
$atts['listsize'] = '6';
 echo $this->refObj->GetPageList($atts,$this->refObj,$fields); 
?>
 
    </td>
  </tr>
</table>
</form>
<?php
}elseif($action == 'edit')
{
?>
<form name="form2" action="mad_type.php" method="post">
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" bgcolor="#E2F5BC">
  <tr>
    <td colspan="2" bgcolor="#EDF9D5" background="images/tbg.gif"><strong>&nbsp;修改</strong>
        <input type="hidden" name="action" value="edit" />
        <input type="hidden" name="step" value="2" />
        <input type="hidden" name="aid" value="<?php echo $aid; ?>" /></td>
  </tr>
  <tr>
    <td width="150" height="20" align="right" bgcolor="#FFFFFF">分类名称：</td>
    <td height="20" bgcolor="#FFFFFF"><input type="text" name="name"  value="<?php echo $sector['name']; ?>">(简短描述一下以便以后管理)</td>
  </tr>
  <tr>
    <td width="150" height="20" align="right" bgcolor="#FFFFFF">分类排列序号：</td>
    <td height="20" bgcolor="#FFFFFF"><input type="text" name="disorder" value="<?php echo $sector['disorder']; ?>">(用于会员页面，序号越小，排列越靠前)</td>
  </tr>
  <tr>
    <td width="150" height="20" align="right" bgcolor="#FFFFFF">该分类下广告数量：</td>
    <td height="20" bgcolor="#FFFFFF"><input type="text" name="num" value="<?php echo $sector['num']; ?>">(该广告系列准备投放的广告位数量)</td>
  </tr>
  <tr>
    <td height="35" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">
      <input name="submit2" type="submit" value="提交" class="np coolbg"/>
      <input type='button' value='返回' onclick='javascript:history.go(-1);'  class="np coolbg" />
    </td>
  </tr>
</table>
</form>
<?php
}elseif($action == 'delete')
{
?>
<form action="mad_type.php" method="post" name="form3">
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" bgcolor="#E2F5BC">
    <tr>
        <td height="20" bgcolor="#EDF9D5" background="images/tbg.gif">
        	<strong>&nbsp;删除分类确认</strong>
          <input type="hidden" name="action" value="delete" />
          <input type="hidden" name="step" value="2" />
          <input type="hidden" name="aid" value="<?php echo $aid; ?>" />
        </td>
    </tr>
      <tr>
        <td height="60" align="center" bgcolor="#FFFFFF">
        	<span class="STYLE1">删除广告分类并不会删除下属广告位,你可以在广告位管理中重新安排广告所属类别或删除！</span>
        </td>
    </tr>
      <tr>
        <td height="35" align="center" bgcolor="#FFFFFF">
        <input name="submit3" type="submit" value="确认删除" class="np coolbg" />
        <input type='button' value='不理返回' onclick='javascript:history.go(-1);'  class="np coolbg" />
       </td>
    </tr>
    </table>
</form>
<?php
}
?>
</body>
</html>